//
//  ZFLCardsViewCell.h
//  iOSAppDevRepo_Example
//
//  Created by 翁胜琼 on 2019/2/21.
//  Copyright © 2019 折疯了. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "ZFLView.h"

NS_ASSUME_NONNULL_BEGIN
@class ZFLCardsViewCell;
@protocol ZFLCardsViewCellDelagate <NSObject>

@optional
- (void)cardViewCellDidRemoveFromSuperView:(ZFLCardsViewCell *)cell;
- (void)cardViewCellDidMoveFromSuperView:(ZFLCardsViewCell*)cell forMovePoint:(CGPoint)point;
- (void)cardViewCellDidSwipeToPoint:(CGPoint)point;

@end

typedef NS_ENUM(NSInteger,ZFLCardsViewCellSwipeDirection) {
    ZFLCardsViewCellSwipeDirectionLeft = 0,
    ZFLCardsViewCellSwipeDirectionRight,
};


@interface ZFLCardsViewCell : ZFLView

@property (nonatomic, strong) UIView *contentView;//!< 内容视图
@property (nonatomic, copy) NSString *reuseIdentifier;//!< 重用标识

@property (nonatomic, assign) CGFloat maxAngle;
@property (nonatomic, assign) CGFloat maxRemoveDistance;
@property (nonatomic, weak) id<ZFLCardsViewCellDelagate> cell_delegate;

/*!
 @brief 移除cell
 @param direction 移除方向
 */
- (void)removeFromSuperviewSwipe:(ZFLCardsViewCellSwipeDirection)direction;

/*!
 @brief 初始化方法
 @param reuseIdentifier 复用id
 @return self
 */
- (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier;
@end

NS_ASSUME_NONNULL_END
